package cn.codecang.mall.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * KafkaInitialConfiguration
 * 初始化kafka
 *
 * @author xiaoluo
 * @date 2023/6/6 19:34
 */
@Configuration
public class KafkaInitialConfiguration {

    /**
     * 创建话题 8个分区,2个副本
     *
     * @return {@link NewTopic}
     */
    @Bean
    public NewTopic initTopic() {
        return new NewTopic("topic.quick.init", 8, (short) 2);
    }
}
